FROM golang:1.17.2 AS build

COPY 9.25 /go/src/9.25

WORKDIR /go/src/9.25

ENV GOPROXY=https://goproxy.cn

RUN go mod init \
	&& go mod tidy \
	&& GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o httpserver

FROM alpine:3.12

COPY --from=build /go/src/9.25/httpserver /bin/httpserver

ENV VERSION=httpserver:v2.0

EXPOSE 80

ENTRYPOINT ["/bin/httpserver"]